

<div style="float:none;clear:both;">
	

<h3>Welcome, <%= current_user.full_name %>, to your Revolution dashboard!</h3>

<% if current_user.has_role?("admin") %>
<div>
	<%= button_to "Generate Auto-Contacts", :controller => 'reports', :action => 'do_auto_contacts' %>
</div>
<% end %>

<div style="float:none;clear:both;">
	<div id="left-column" style="width:48%">

		<div style="float:none;clear:both;">
		<fieldset><legend><strong>My Tasks</strong></legend>
			
			<div class="even" style="border: solid #536A97 6px; width:97%;">
				<ul>
					<li>You have <%= current_user.open_contacts.length rescue nil %> open contacts.</li>
					<li>Your open contacts are an average of <%= current_user.average_open_contact_age rescue nil %> days old.</li>
					<li><%= current_user.in_progress_status rescue nil %> </li>
				</ul>
			</div>
			
			<%= link_to 'manage my contacts', :controller => 'contacts', :action => 'manage' %> | 
			<%= link_to 'view recent follow-ups', :controller => 'follow_ups', :action => 'manage' %>
			<% current_user.live_contacts.sort_by(&:created_at).each do |c| %>
				<div class="<%= cycle("even","odd") %>" style="padding:.3em;">
					<%= c.contact_type.name rescue nil %> (<%= c.status %>)<br>
					<div class="tiny">
						<%= time_ago_in_words c.created_at %> old
						<%= link_to "[follow-up]", {:controller => 'contacts', :action => 'follow_up', :id => c.id},
												   {:title => "Attributed To: #{c.attributed_to} \nComments: #{c.comments}"} rescue nil %>
					</div>
				</div>
			<% end %>
			<div>
				<%= link_to 'add unattributed contact', :controller => 'contacts', :action => 'new_contact' %>
			</div>
		</fieldset>
		</div>

	</div>



	<div id="right-column" style="width:48%">

		<div style="float:none;clear:both;">
		<fieldset><legend><strong>Groups I Lead</strong></legend>
			<% current_user.small_groups_i_lead.each do |g| %>
				<div>
					<%= link_to "#{g.name}", :controller => 'groups', :action => 'show', :id => g.id %>
				</div>
			<% end %>
		</fieldset>
		<fieldset><legend><strong>Groups I'm Responsible For</strong></legend>
			<% current_user.groups.each do |g| %>
				<div>
					<%= link_to "#{g.name}", :controller => 'groups', :action => 'show', :id => g.id %>
				</div>
			<% end %>
		</fieldset>
		<fieldset><legend><strong>My Departments</strong></legend>
			<% current_user.departments.each do |d| %>
				<div>
					<%= link_to "#{d.name}", :controller => 'departments', :action => 'show', :id => d.id %>
				</div>
			<% end %>
		</fieldset>
		<fieldset><legend><strong>Authorized Ministries</strong></legend>
			<span style="float:right;">
				Contacts:
			</span>
			<% current_user.ministries.each do |m| %>
				<div class="<%= cycle("even","odd") %>">
					<span style="float:left;">
						<%= link_to "#{m.name}", :controller => 'ministries', :action => 'show', :id => m.id %>
					</span>
					<span style="float:right;">
						<%= m.open_in_progress_summary rescue nil %>
					</span>
				</div>
			<% end %>
		</fieldset>
		<fieldset><legend><strong>My Teams</strong></legend>
			<% current_user.teams.each do |t| %>
				<div>
					<%= link_to "#{t.name}", :controller => 'teams', :action => 'show', :id => t.id %>
				</div>
			<% end %>
		</fieldset>

		
		</div>

	</div>

<div style="float:none;clear:both"></div>
</div>
</div>